This invention relates generally to a system and method for controlling the flow of data in a data transfer protocol and in particular to a system and method for controlling the flow of data between a diskless server and a client computer.
Some data transfer protocols are specifically intended to be used for the transfer of data between two personal computers connected to a computer network. An example of such a protocol is the server message block protocol (SMB) authored by Microsoft Corporation of Redmond, Wash. The SMB protocol is intended to permit data to be transferred efficiently between a server computer and a client computer connected together by a network. In the SMB protocol, a client computer (xe2x80x9cclientxe2x80x9d) sends a request to a server computer (xe2x80x9cserverxe2x80x9d) to access a server-based file data stream or a server-based print data stream. The server then sends a reply back to the client when the request for data has been fulfilled and completed. However, there is a time limit (known as a time-out interval) on a request and if the server has not replied to the client within the time-out interval, the client reports to its operating system that an error has occurred during the data transfer and terminates the data transfer session with the server. This permits the client computer to assume that a failure has occurred somewhere in the communications system and unilaterally terminate the communications session if the time-out interval is exceeded. The time-out interval may vary, but may be approximately 45 seconds for the SMB protocol.
In a typical server computer with some form of persistent storage device, such as a hard disk drive, a tape drive, an optical drive or the like, the time limit of the time-out interval poses no problem. Data may be written to the persistent storage device as it is received. The time-out interval is not exceeded since the replies may be sent back as soon as the data has been stored. Then, the data may be read from the disk later when timing is not as critical. For example, the data may be spooled to the server computer""s disk and then later printed from the data stored on the disk.
In a typical printer, an image is broken down into a sequence of blocks of data by the client computer and each block of data may then be transferred to a print server connected to the printer using a data transfer protocol. As each block of data is received by the print server, it may be stored on a hard drive within the print server until a complete page has been received. As each block of data is received, a reply may be sent back to the client computer sending the block of data. The page is then interpreted by the print server and imaged by the printer. In this manner, data to be printed by the printer may be transferred to the printer using a typical data transfer protocol, such as SMB. With this typical printer, it is unlikely that the time-out interval will be exceeded since the data may be stored on the disk and then later printed from the disk.
The time limit of the time-out interval associated with the data transfer protocol, however, becomes more problematic when a diskless server system is attempting to communicate data using a data transfer protocol. An example of a typical diskless server system is a printer connected to a computer network, where one or more client computers also connected the computer network have access to the printer over the computer network. The problem is that certain types of data requests may require a lengthy computation prior to any reply being sent back to the client so that the time-out interval may be exceeded and the data flow may be terminated. For example, once the last block of data from a page to be printed is received, the page (which may have a complex image) is printed. This may require a larger amount of computation time in order to print the page. While requests which require the larger amounts of computation time are a small minority of the total number of data requests, the time between such requests and the associated replies may exceed the time-out interval since the diskless system is still performing some computation when the time-out interval expires. For example, over a sequence of data requests, a diskless printer can receive a page to be printed and then spend several minutes interpreting the page before sending a reply back to the client. The expiration of the time-out interval causes the data transfer session to be terminated by the client, which is disruptive since the data transfer session must be reestablished and the print job must be restarted. Similarly, if the data requests may be generated by a batch program, the batch program may unexpectedly and undesirably terminate because of the termination of the data transfer session.
Due to this time-out interval problem with data transfer protocols, users and developers may typically elect to use another data transfer protocol for communicating data to a networked printer to avoid the problem. It is desirable, however, to avoid the above-described time-out interval problem with these diskless systems while still utilizing a data transfer protocol with a time-out interval, such as SMB, and it is to this end that the present invention is directed.
The data flow control system and method in accordance with the invention solves the foregoing and other problems associated with data transfer protocols. In particular, the system prevents the time-out interval from being exceeded so that the data transfer session between the client computer and the diskless server is not terminated. In more detail, the system may include a protocol component, a buffer, and an application component, resident on a diskless server, which attempt to ensure that the time-out interval is not exceeded. The protocol component receives the data requests from the client computer and then, at the appropriate times, may communicate a reply back to the client computer within the time-out interval. The buffer temporarily stores the incoming data requests in the memory of the server while the application component interacts with the software application being executed by the server. While the amount of data in the buffer is below a predetermined level (indicating that the delay introduced by the server will not exceed the time-out interval), the protocol component does not add any delay into the response from the server. However, if the data in the buffer exceeds some predetermined level (indicating that the server is not keeping up with the incoming data transfers and may not be able to respond to the client within the time-out interval), the protocol component may insert delays into the replies being sent to the client in anticipation that the time-out interval may soon be exceeded.
In other words, although the server is able to respond to the current data requests within the time-out interval, time delays may be inserted into these replies so that the server has a chance to reduce the level of data in the buffer. Thus, rather than having a single delay for a particular block of data exceed the time-out interval and causing a termination of the data transfer session, the system may insert delays prior to the transfer of the block of data to prevent the problem. The inserted delays smooth out the irregularities of the supply of data by the client computers and the demand for data by the application component. Therefore, the system anticipates a time-out interval problem (based on the level of data in the buffer) and delays the replies to the client for some predetermined time so that the server may catch up to the data transfer requests.
Thus, in accordance with the invention, an apparatus within a diskless server for controlling the data flow between a client computer and the diskless server using a protocol is provided in which the diskless server must respond to the client computer within a time-out interval to avoid a termination of the data flow. The apparatus comprises a protocol component for receiving a data request from the client computer and for sending a reply back to the client computer when the data request has been fulfilled and an application component that may process the data request. The apparatus further comprises a buffer for storing the incoming data requests in a memory of the diskless server while the application component is processing other data requests. The protocol component delays the reply when the amount of data in the buffer exceeds a predetermined threshold so that the client computer does not terminate the data flow because of the time-out interval being exceeded.
A method for controlling the data flow between a client computer and a diskless server using a protocol in which the diskless server must respond to the client computer within a time-out interval is also provided. The method comprises receiving and processing a data request from the client computer, storing incoming data requests while the other data requests are being processed, and generating a reply to the client computer when the data request has been fulfilled. The step of generating the replies further comprises inserting a delay into the reply when the amount of data stored exceeds a predetermined threshold so that the client computer does not terminate the data flow because the time-out interval is exceeded.
In accordance with another aspect of the invention, an apparatus within a print server connected to a printer for controlling the data flow between a client computer and the print server using a server message block (SMB) protocol is provided in which the print server must respond to the client computer within a time-out interval. The apparatus comprises a protocol component for receiving a data request from the client computer and for replying to the client computer when the data request has been fulfilled. A print engine processes the data request in order to print the image corresponding to the data request. The apparatus further comprises a buffer for storing the incoming data requests in a random access memory of the print server while the application component is processing other data requests, and a delay inserter that delays the reply sent to the client computer when the amount of data in the buffer satisfies certain conditions to avoid the client computer terminating the data flow because a time-out interval is exceeded.